Repository navigation
docs: describe idempotent consumption without overstating its guarantees - #6
Merged
Merged
Conversation
An in-flight claim is treated like a recorded key, so a redelivery that arrives while a dead worker's claim is held is acknowledged and discarded. Document that loss window, the double run after a crash before remember(), and how leaseSeconds relates to each transport's redelivery time. Also drop the at-most-once and no-message-is-lost wording, scope the keyResolver example by URN and return a string, correct the claim about messages without an identity, and explain how a PDO store frees an expired lease.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The idempotency page and the README section described a guarantee the dispatcher does not give.
Dispatcher::runHandler()treats a claimed-but-not-recorded key like a recorded one, so the duplicate is acknowledged and discarded. This rewrites the docs to say what happens today (no source change):leaseSeconds: 300,PdoTransportretryAfter: 90) it always does; on RabbitMQ a closed connection redelivers at once.remember()causes a second run once the lease lapses, so "at most once" is gone.release()then updates nothing.leaseSeconds: above the slowest handler, below the transport's redelivery time, with a per-transport table (PDO, Redis, RabbitMQ).0means no expiry, not no lease.keyResolverexample: scope the key by URN and return a string (a different message type for the same order was discarded as a duplicate; anintid was silently ignored).trace_idis dead-lettered by the envelope validator before deduplication, so the "processed without deduplication" sentence is removed.at-least-oncepages (FAQ, Core Concepts, Retries, Transport-PDO, Troubleshooting) no longer present deduplication as a replacement for an idempotent handler;job.droppedis documented for duplicates.Verification
The three loss and double-run cases were reproduced end to end with a real
PdoTransport(SQLite file), a shared store with a lease and worker processes killed withSIGKILL; the shorter-lease case recovers.wiki-sync.sh --check docspasses.The dispatcher behaviour itself (the in-flight claim being dropped) is not changed here and is left for a separate decision.